﻿using System;
using UnityEngine;

public class Action1003 : GameAction
{
	public class Passport
	{
		public string PassportId { get; set; }
		public string Password { get; set; }
	}
	private ActionResult actionResult;

	/// <summary>
	/// 自定义消息
	/// </summary>
	public Action1003()
		: base((int)ActionType.SelfRegist)
	{
	}

	protected override void SendParameter(NetWriter writer, ActionParam actionParam)
	{
		writer.writeInt32("MobileType", GameSetting.Instance.MobileType);
		writer.writeInt32("GameID", GameSetting.Instance.GameID);
		writer.writeString("RetailID", GameSetting.Instance.RetailID);
		writer.writeString("ClientAppVersion", GameSetting.Instance.ClientAppVersion);
		writer.writeInt32("ScreenX", GameSetting.Instance.ScreenX);
		writer.writeInt32("ScreenY", GameSetting.Instance.ScreenY);
		writer.writeString("DeviceID", GameSetting.Instance.DeviceID);
		writer.writeInt32("ServerID", GameSetting.Instance.ServerID);
		writer.writeString("PassPort", GameSetting.Instance.Pid);
		writer.writeString("PassWord", GameSetting.Instance.Password);
	}

	/// <summary>
	/// 服务器发送过来的解包
	/// </summary>
	/// <param name="reader"></param>
	protected override void DecodePackage(NetReader reader)
	{
		actionResult = new ActionResult();
		actionResult["passportID"] = reader.readString();
		actionResult["password"] = reader.readString();
		Debug.LogError("######服务器返回的账号密码:" + actionResult["passportID"]);
	}

	public override ActionResult GetResponseData()
	{
		return actionResult;
	}
}
